package com.graduation.smartparkingplatform.Response;

public class ResponseUtils {
  /**
   * 带实体的统一返回
   *
   * @param data 实体
   * @param <T> 实体类型
   * @return
   */
  public static <T> Response buildSuccess(T data) {
    return new Response<T>(ResultEnums.SUCCESS, data);
  }

  public static Response buildSuccess() {
    return new Response(ResultEnums.SUCCESS);
  }

  public static Response buildSuccess(String msg) {
    return new Response(ResultEnums.SUCCESS.getCode(), msg);
  }

  public static Response buildSuccess(String code, String msg) {
    return new Response(code, msg);
  }

  public static <T> Response buildSuccess(String code, String msg, T data) {
    return new Response<T>(code, msg, data);
  }

  public static Response buildSuccess(ResultEnums resultEnums) {
    return new Response(resultEnums);
  }

  public static <T> Response buildError(T data) {
    return new Response<T>(ResultEnums.ERROR, data);
  }

  public static Response buildError() {
    return new Response(ResultEnums.ERROR);
  }

  public static Response buildError(String msg) {
    return new Response(ResultEnums.ERROR.getCode(), msg);
  }

  public static Response buildError(String code, String msg) {
    return new Response(code, msg);
  }

  public static <T> Response buildError(String code, String msg, T data) {
    return new Response<T>(code, msg, data);
  }

  public static Response buildError(ResultEnums resultEnums) {
    return new Response(resultEnums);
  }

  public static <T> Response buildIDENTIT_ERROR(T data) {
    return new Response<T>(ResultEnums.IDENTIT_ERROR, data);
  }

  public static Response buildIDENTIT_ERROR() {
    return new Response(ResultEnums.IDENTIT_ERROR);
  }

  public static Response buildIDENTIT_ERROR(String msg) {
    return new Response(ResultEnums.IDENTIT_ERROR.getCode(), msg);
  }

  public static Response buildIDENTIT_ERROR(String code, String msg) {
    return new Response(code, msg);
  }

  public static <T> Response buildIDENTIT_ERROR(String code, String msg, T data) {
    return new Response<T>(code, msg, data);
  }

  public static Response buildIDENTIT_ERROR(ResultEnums resultEnums) {
    return new Response(resultEnums);
  }

  public static <T> Response buildAUTH_SUCCESS(T data) {
    return new Response<T>(ResultEnums.AUTH_SUCCESS, data);
  }

  public static Response buildAUTH_SUCCESS() {
    return new Response(ResultEnums.AUTH_SUCCESS);
  }

  public static Response buildAUTH_SUCCESS(String msg) {
    return new Response(ResultEnums.AUTH_SUCCESS.getCode(), msg);
  }

  public static Response buildAUTH_SUCCESS(String code, String msg) {
    return new Response(code, msg);
  }

  public static <T> Response buildAUTH_SUCCESS(String code, String msg, T data) {
    return new Response<T>(code, msg, data);
  }

  public static Response buildAUTH_SUCCESS(ResultEnums resultEnums) {
    return new Response(resultEnums);
  }

  public static <T> Response buildLOGIN_ERROR(T data) {
    return new Response<T>(ResultEnums.LOGIN_ERROR, data);
  }

  public static Response buildLOGIN_ERROR() {
    return new Response(ResultEnums.LOGIN_ERROR);
  }

  public static Response buildLOGIN_ERROR(String msg) {
    return new Response(ResultEnums.LOGIN_ERROR.getCode(), msg);
  }

  public static Response buildLOGIN_ERROR(String code, String msg) {
    return new Response(code, msg);
  }

  public static <T> Response buildLOGIN_ERROR(String code, String msg, T data) {
    return new Response<T>(code, msg, data);
  }

  public static Response buildLOGIN_ERROR(ResultEnums resultEnums) {
    return new Response(resultEnums);
  }

  public static <T> Response buildAUTH_ERROR(T data) {
    return new Response<T>(ResultEnums.AUTH_ERROR, data);
  }

  public static Response buildAUTH_ERROR() {
    return new Response(ResultEnums.AUTH_ERROR);
  }

  public static Response buildAUTH_ERROR(String msg) {
    return new Response(ResultEnums.AUTH_ERROR.getCode(), msg);
  }

  public static Response buildAUTH_ERROR(String code, String msg) {
    return new Response(code, msg);
  }

  public static <T> Response buildAUTH_ERROR(String code, String msg, T data) {
    return new Response<T>(code, msg, data);
  }

  public static Response buildAUTH_ERROR(ResultEnums resultEnums) {
    return new Response(resultEnums);
  }

  public static <T> Response buildSYSTEM_ERROR(T data) {
    return new Response<T>(ResultEnums.SYSTEM_ERROR, data);
  }

  public static Response buildSYSTEM_ERROR() {
    return new Response(ResultEnums.SYSTEM_ERROR);
  }

  public static Response buildSYSTEM_ERROR(String msg) {
    return new Response(ResultEnums.SYSTEM_ERROR.getCode(), msg);
  }

  public static Response buildSYSTEM_ERROR(String code, String msg) {
    return new Response(code, msg);
  }

  public static <T> Response buildSYSTEM_ERROR(String code, String msg, T data) {
    return new Response<T>(code, msg, data);
  }

  public static Response buildSYSTEM_ERROR(ResultEnums resultEnums) {
    return new Response(resultEnums);
  }

  public static <T> Response buildBUSSINESS_ERROR(T data) {
    return new Response<T>(ResultEnums.BUSSINESS_ERROR, data);
  }

  public static Response buildBUSSINESS_ERROR() {
    return new Response(ResultEnums.BUSSINESS_ERROR);
  }

  public static Response buildBUSSINESS_ERROR(String msg) {
    return new Response(ResultEnums.BUSSINESS_ERROR.getCode(), msg);
  }

  public static Response buildBUSSINESS_ERROR(String code, String msg) {
    return new Response(code, msg);
  }

  public static <T> Response buildBUSSINESS_ERROR(String code, String msg, T data) {
    return new Response<T>(code, msg, data);
  }

  public static Response buildBUSSINESS_ERROR(ResultEnums resultEnums) {
    return new Response(resultEnums);
  }

  public static <T> Response buildVERIFY_CODE_EXPIRE(T data) {
    return new Response<T>(ResultEnums.VERIFY_CODE_EXPIRE, data);
  }

  public static Response buildVERIFY_CODE_EXPIRE() {
    return new Response(ResultEnums.VERIFY_CODE_EXPIRE);
  }

  public static Response buildVERIFY_CODE_EXPIRE(String msg) {
    return new Response(ResultEnums.VERIFY_CODE_EXPIRE.getCode(), msg);
  }

  public static Response buildVERIFY_CODE_EXPIRE(String code, String msg) {
    return new Response(code, msg);
  }

  public static <T> Response buildVERIFY_CODE_EXPIRE(String code, String msg, T data) {
    return new Response<T>(code, msg, data);
  }

  public static Response buildVERIFY_CODE_EXPIRE(ResultEnums resultEnums) {
    return new Response(resultEnums);
  }

  public static <T> Response buildVERIFY_CODE_ERROR(T data) {
    return new Response<T>(ResultEnums.VERIFY_CODE_ERROR, data);
  }

  public static Response buildVERIFY_CODE_ERROR() {
    return new Response(ResultEnums.VERIFY_CODE_ERROR);
  }

  public static Response buildVERIFY_CODE_ERROR(String msg) {
    return new Response(ResultEnums.VERIFY_CODE_ERROR.getCode(), msg);
  }

  public static Response buildVERIFY_CODE_ERROR(String code, String msg) {
    return new Response(code, msg);
  }

  public static <T> Response buildVERIFY_CODE_ERROR(String code, String msg, T data) {
    return new Response<T>(code, msg, data);
  }

  public static Response buildVERIFY_CODE_ERROR(ResultEnums resultEnums) {
    return new Response(resultEnums);
  }

  public static <T> Response buildPARAM_ERROR(T data) {
    return new Response<T>(ResultEnums.PARAM_ERROR, data);
  }

  public static Response buildPARAM_ERROR() {
    return new Response(ResultEnums.PARAM_ERROR);
  }

  public static Response buildPARAM_ERROR(String msg) {
    return new Response(ResultEnums.PARAM_ERROR.getCode(), msg);
  }

  public static Response buildPARAM_ERROR(String code, String msg) {
    return new Response(code, msg);
  }

  public static <T> Response buildPARAM_ERROR(String code, String msg, T data) {
    return new Response<T>(code, msg, data);
  }

  public static Response buildPARAM_ERROR(ResultEnums resultEnums) {
    return new Response(resultEnums);
  }
}
